import java.io.IOException;

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class TestServlet implements Servlet {

    private String грубоеСлово;

    @Override
    public void init(ServletConfig config) throws ServletException {
        грубоеСлово = config.getInitParameter("rudeWord");
        System.out.println("Parameter: " + грубоеСлово);
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        String name = req.getParameter("name");
        res.getOutputStream().write(("Hello " + name + ", " + грубоеСлово).getBytes("UTF-8"));
    }

    @Override
    public String getServletInfo() {
        return "Some Servlet Info";
    }

    @Override
    public void destroy() {
        System.out.println("Destroy");
    }

}
